#!/bin/bash

# postinst script for mdb
#
# see: dh_installdeb(1)

#set -e

# summary of how this script can be called:
#        * <postinst> \`configure' <most-recently-configured-version>
#        * <old-postinst> \`abort-upgrade' <new version>
#        * <conflictor's-postinst> \`abort-remove' \`in-favour' <package>
#          <new-version>
#        * <postinst> \`abort-remove'
#        * <deconfigured's-postinst> \`abort-deconfigure' \`in-favour'
#          <failed-install-package> <version> \`removing'
#          <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

PATH=/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
export PATH

if [ "${BASEDIR:=/}" = "/" ]; then
    BASEDIR=""
else
    BASEDIR_OPT="-b $BASEDIR"
fi

case "$1" in
    configure)
        chown root:bin $BASEDIR/usr/lib/mdb/proc/amd64
	chown root:bin $BASEDIR/usr/platform/i86pc/lib
	chown root:bin $BASEDIR/usr/platform/i86xpv/lib
	chown root:sys $BASEDIR/kernel/kmdb
	chown root:sys $BASEDIR/kernel/kmdb/amd64
	chown root:sys $BASEDIR/platform
	chown root:sys $BASEDIR/platform/i86pc
	chown root:sys $BASEDIR/platform/i86pc/kernel
	chown root:sys $BASEDIR/platform/i86pc/kernel/kmdb
	chown root:sys $BASEDIR/platform/i86pc/kernel/kmdb/amd64
	chown root:sys $BASEDIR/platform/i86xpv
	chown root:sys $BASEDIR/platform/i86xpv/kernel
	chown root:sys $BASEDIR/platform/i86xpv/kernel/kmdb
	chown root:sys $BASEDIR/platform/i86xpv/kernel/kmdb/amd64
	chown root:sys $BASEDIR/usr/lib/mdb
	chown root:sys $BASEDIR/usr/lib/mdb/kvm
	chown root:sys $BASEDIR/usr/lib/mdb/kvm/amd64
	chown root:sys $BASEDIR/usr/lib/mdb/proc
	chown root:sys $BASEDIR/usr/lib/mdb/raw
	chown root:sys $BASEDIR/usr/lib/mdb/raw
	chown root:sys $BASEDIR/usr/lib/mdb/raw/amd64
	chown root:sys $BASEDIR/usr/lib/mdb/raw/amd64
	chown root:sys $BASEDIR/usr/platform
	chown root:sys $BASEDIR/usr/platform/i86pc
	chown root:sys $BASEDIR/usr/platform/i86pc/lib/mdb
	chown root:sys $BASEDIR/usr/platform/i86pc/lib/mdb/kvm
	chown root:sys $BASEDIR/usr/platform/i86pc/lib/mdb/kvm/amd64
	chown root:sys $BASEDIR/usr/platform/i86xpv
	chown root:sys $BASEDIR/usr/platform/i86xpv/lib/mdb
	chown root:sys $BASEDIR/usr/platform/i86xpv/lib/mdb/kvm
	chown root:sys $BASEDIR/usr/platform/i86xpv/lib/mdb/kvm/amd64
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/klmmod ] && rm -f $BASEDIR/kernel/kmdb/amd64/klmmod
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/klmmod"
	    chown root:bin "$BASEDIR/kernel/kmdb/amd64/klmmod"
	fi
	chmod 0555 "$BASEDIR/usr/bin/mdb"
	chown root:bin "$BASEDIR/usr/bin/mdb"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/klmmod.so"
	chown root:bin "$BASEDIR/usr/lib/mdb/kvm/amd64/klmmod.so"
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/arp ] && rm -f $BASEDIR/kernel/kmdb/amd64/arp
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/arp"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/arp"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/cpc ] && rm -f $BASEDIR/kernel/kmdb/amd64/cpc
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/cpc"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/cpc"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/cpu.generic ] && rm -f $BASEDIR/kernel/kmdb/amd64/cpu.generic
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/cpu.generic"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/cpu.generic"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/cpu_ms.AuthenticAMD.15 ] && rm -f $BASEDIR/kernel/kmdb/amd64/cpu_ms.AuthenticAMD.15
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/cpu_ms.AuthenticAMD.15"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/cpu_ms.AuthenticAMD.15"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/crypto ] && rm -f $BASEDIR/kernel/kmdb/amd64/crypto
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/crypto"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/crypto"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/genunix ] && rm -f $BASEDIR/kernel/kmdb/amd64/genunix
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/genunix"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/genunix"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/hook ] && rm -f $BASEDIR/kernel/kmdb/amd64/hook
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/hook"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/hook"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/i40e ] && rm -f $BASEDIR/kernel/kmdb/amd64/i40e
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/i40e"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/i40e"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/ip ] && rm -f $BASEDIR/kernel/kmdb/amd64/ip
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/ip"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/ip"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/ipc ] && rm -f $BASEDIR/kernel/kmdb/amd64/ipc
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/ipc"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/ipc"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/ipp ] && rm -f $BASEDIR/kernel/kmdb/amd64/ipp
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/ipp"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/ipp"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/krtld ] && rm -f $BASEDIR/kernel/kmdb/amd64/krtld
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/krtld"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/krtld"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/lofs ] && rm -f $BASEDIR/kernel/kmdb/amd64/lofs
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/lofs"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/lofs"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/logindmux ] && rm -f $BASEDIR/kernel/kmdb/amd64/logindmux
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/logindmux"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/logindmux"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/mac ] && rm -f $BASEDIR/kernel/kmdb/amd64/mac
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/mac"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/mac"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/mdb_ds ] && rm -f $BASEDIR/kernel/kmdb/amd64/mdb_ds
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/mdb_ds"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/mdb_ds"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/mm ] && rm -f $BASEDIR/kernel/kmdb/amd64/mm
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/mm"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/mm"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/mpt ] && rm -f $BASEDIR/kernel/kmdb/amd64/mpt
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/mpt"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/mpt"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/mpt_sas ] && rm -f $BASEDIR/kernel/kmdb/amd64/mpt_sas
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/mpt_sas"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/mpt_sas"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/mr_sas ] && rm -f $BASEDIR/kernel/kmdb/amd64/mr_sas
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/mr_sas"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/mr_sas"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/neti ] && rm -f $BASEDIR/kernel/kmdb/amd64/neti
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/neti"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/neti"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/nfs ] && rm -f $BASEDIR/kernel/kmdb/amd64/nfs
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/nfs"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/nfs"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/ptm ] && rm -f $BASEDIR/kernel/kmdb/amd64/ptm
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/ptm"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/ptm"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/random ] && rm -f $BASEDIR/kernel/kmdb/amd64/random
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/random"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/random"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/s1394 ] && rm -f $BASEDIR/kernel/kmdb/amd64/s1394
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/s1394"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/s1394"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/sata ] && rm -f $BASEDIR/kernel/kmdb/amd64/sata
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/sata"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/sata"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/scsi_vhci ] && rm -f $BASEDIR/kernel/kmdb/amd64/scsi_vhci
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/scsi_vhci"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/scsi_vhci"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/sctp ] && rm -f $BASEDIR/kernel/kmdb/amd64/sctp
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/sctp"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/sctp"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/sd ] && rm -f $BASEDIR/kernel/kmdb/amd64/sd
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/sd"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/sd"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/sockfs ] && rm -f $BASEDIR/kernel/kmdb/amd64/sockfs
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/sockfs"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/sockfs"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/specfs ] && rm -f $BASEDIR/kernel/kmdb/amd64/specfs
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/specfs"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/specfs"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/sppp ] && rm -f $BASEDIR/kernel/kmdb/amd64/sppp
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/sppp"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/sppp"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/ufs ] && rm -f $BASEDIR/kernel/kmdb/amd64/ufs
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/ufs"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/ufs"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/uhci ] && rm -f $BASEDIR/kernel/kmdb/amd64/uhci
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/uhci"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/uhci"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kmdb/amd64/usba ] && rm -f $BASEDIR/kernel/kmdb/amd64/usba
	else
	    chmod 0555 "$BASEDIR/kernel/kmdb/amd64/usba"
	    chown root:sys "$BASEDIR/kernel/kmdb/amd64/usba"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/platform/i86pc/kernel/kmdb/amd64/apix ] && rm -f $BASEDIR/platform/i86pc/kernel/kmdb/amd64/apix
	else
	    chmod 0555 "$BASEDIR/platform/i86pc/kernel/kmdb/amd64/apix"
	    chown root:sys "$BASEDIR/platform/i86pc/kernel/kmdb/amd64/apix"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/platform/i86pc/kernel/kmdb/amd64/pcplusmp ] && rm -f $BASEDIR/platform/i86pc/kernel/kmdb/amd64/pcplusmp
	else
	    chmod 0555 "$BASEDIR/platform/i86pc/kernel/kmdb/amd64/pcplusmp"
	    chown root:sys "$BASEDIR/platform/i86pc/kernel/kmdb/amd64/pcplusmp"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/platform/i86pc/kernel/kmdb/amd64/unix ] && rm -f $BASEDIR/platform/i86pc/kernel/kmdb/amd64/unix
	else
	    chmod 0555 "$BASEDIR/platform/i86pc/kernel/kmdb/amd64/unix"
	    chown root:sys "$BASEDIR/platform/i86pc/kernel/kmdb/amd64/unix"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/platform/i86pc/kernel/kmdb/amd64/uppc ] && rm -f $BASEDIR/platform/i86pc/kernel/kmdb/amd64/uppc
	else
	    chmod 0555 "$BASEDIR/platform/i86pc/kernel/kmdb/amd64/uppc"
	    chown root:sys "$BASEDIR/platform/i86pc/kernel/kmdb/amd64/uppc"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/platform/i86xpv/kernel/kmdb/amd64/unix ] && rm -f $BASEDIR/platform/i86xpv/kernel/kmdb/amd64/unix
	else
	    chmod 0555 "$BASEDIR/platform/i86xpv/kernel/kmdb/amd64/unix"
	    chown root:sys "$BASEDIR/platform/i86xpv/kernel/kmdb/amd64/unix"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/platform/i86xpv/kernel/kmdb/amd64/xpv_psm ] && rm -f $BASEDIR/platform/i86xpv/kernel/kmdb/amd64/xpv_psm
	else
	    chmod 0555 "$BASEDIR/platform/i86xpv/kernel/kmdb/amd64/xpv_psm"
	    chown root:sys "$BASEDIR/platform/i86xpv/kernel/kmdb/amd64/xpv_psm"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/platform/i86xpv/kernel/kmdb/amd64/xpv_uppc ] && rm -f $BASEDIR/platform/i86xpv/kernel/kmdb/amd64/xpv_uppc
	else
	    chmod 0555 "$BASEDIR/platform/i86xpv/kernel/kmdb/amd64/xpv_uppc"
	    chown root:sys "$BASEDIR/platform/i86xpv/kernel/kmdb/amd64/xpv_uppc"
	fi
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/arp.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/arp.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/cpc.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/cpc.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/cpu.generic.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/cpu.generic.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/cpu_ms.AuthenticAMD.15.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/cpu_ms.AuthenticAMD.15.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/crypto.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/crypto.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/genunix.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/genunix.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/hook.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/hook.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/i40e.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/i40e.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/ip.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/ip.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/ipc.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/ipc.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/ipp.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/ipp.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/krtld.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/krtld.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/lofs.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/lofs.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/logindmux.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/logindmux.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/mac.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/mac.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/mdb_kb.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/mdb_kb.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/mdb_ks.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/mdb_ks.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/mm.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/mm.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/mpt.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/mpt.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/mpt_sas.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/mpt_sas.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/mr_sas.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/mr_sas.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/neti.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/neti.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/nfs.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/nfs.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/ptm.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/ptm.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/random.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/random.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/s1394.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/s1394.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/sata.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/sata.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/scsi_vhci.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/scsi_vhci.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/sctp.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/sctp.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/sd.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/sd.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/smbios.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/smbios.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/sockfs.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/sockfs.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/specfs.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/specfs.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/sppp.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/sppp.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/ufs.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/ufs.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/uhci.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/uhci.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/kvm/amd64/usba.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/kvm/amd64/usba.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/proc/amd64/ld.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/proc/amd64/ld.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/proc/amd64/libavl.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/proc/amd64/libavl.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/proc/amd64/libc.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/proc/amd64/libc.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/proc/amd64/libnvpair.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/proc/amd64/libnvpair.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/proc/amd64/libproc.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/proc/amd64/libproc.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/proc/amd64/libsmbios.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/proc/amd64/libsmbios.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/proc/amd64/libsysevent.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/proc/amd64/libsysevent.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/proc/amd64/libtopo.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/proc/amd64/libtopo.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/proc/amd64/libumem.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/proc/amd64/libumem.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/proc/amd64/libuutil.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/proc/amd64/libuutil.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/proc/amd64/list.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/proc/amd64/list.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/proc/amd64/mdb_ds.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/proc/amd64/mdb_ds.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/proc/amd64/mdb_test.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/proc/amd64/mdb_test.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/proc/amd64/svc.configd.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/proc/amd64/svc.configd.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/proc/amd64/svc.startd.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/proc/amd64/svc.startd.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/proc/ld.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/proc/ld.so"
	chmod 0555 "$BASEDIR/usr/lib/mdb/raw/amd64/disk_label.so"
	chown root:sys "$BASEDIR/usr/lib/mdb/raw/amd64/disk_label.so"
	chmod 0555 "$BASEDIR/usr/platform/i86pc/lib/mdb/kvm/amd64/apix.so"
	chown root:sys "$BASEDIR/usr/platform/i86pc/lib/mdb/kvm/amd64/apix.so"
	chmod 0555 "$BASEDIR/usr/platform/i86pc/lib/mdb/kvm/amd64/pcplusmp.so"
	chown root:sys "$BASEDIR/usr/platform/i86pc/lib/mdb/kvm/amd64/pcplusmp.so"
	chmod 0555 "$BASEDIR/usr/platform/i86pc/lib/mdb/kvm/amd64/unix.so"
	chown root:sys "$BASEDIR/usr/platform/i86pc/lib/mdb/kvm/amd64/unix.so"
	chmod 0555 "$BASEDIR/usr/platform/i86pc/lib/mdb/kvm/amd64/uppc.so"
	chown root:sys "$BASEDIR/usr/platform/i86pc/lib/mdb/kvm/amd64/uppc.so"
	chmod 0555 "$BASEDIR/usr/platform/i86xpv/lib/mdb/kvm/amd64/unix.so"
	chown root:sys "$BASEDIR/usr/platform/i86xpv/lib/mdb/kvm/amd64/unix.so"
	chmod 0555 "$BASEDIR/usr/platform/i86xpv/lib/mdb/kvm/amd64/xpv.so"
	chown root:sys "$BASEDIR/usr/platform/i86xpv/lib/mdb/kvm/amd64/xpv.so"
	chmod 0555 "$BASEDIR/usr/platform/i86xpv/lib/mdb/kvm/amd64/xpv_psm.so"
	chown root:sys "$BASEDIR/usr/platform/i86xpv/lib/mdb/kvm/amd64/xpv_psm.so"
	chmod 0555 "$BASEDIR/usr/platform/i86xpv/lib/mdb/kvm/amd64/xpv_uppc.so"
	chown root:sys "$BASEDIR/usr/platform/i86xpv/lib/mdb/kvm/amd64/xpv_uppc.so"
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst called with unknown argument '$1'" >&2
        exit 1
    ;;
esac



# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0

